import UserHouse from "@/pages/userHouse"
import { useState } from "react"

/*
 * @Author: zhangzhanyan 
 * @Date: 2021-07-18 21:15:23 
 * @Last Modified by: zhangzhnayan
 * @Last Modified time: 2021-07-21 19:49:36
 */
import mock from "../../mock/main_tow.json"
import {history} from "umi"

export default function main_dl(){
    let [list,setState]=useState(mock)
     function UserHouse(item:any){
        console.log(item)
        if(item.name==="二手房"){
            console.log(123)
            history.push('/userhouse');
        }
    }
    return (
        <div className="Main_dl">
            {
              list.map((item,index)=>{
                  return <dl key={index} onClick={()=>UserHouse(item)}>
                      <dt>
                          <img src={item.images} alt="" />
                      </dt>
                      <dd>{item.name}</dd>
                  </dl>
              })
            }
        </div>
    )
} 